//
//  ContactGroupCell.m
//  timelyRain
//
//  Created by Jiafei Wei on 16/9/21.
//  Copyright © 2016年 Jiafei Wei. All rights reserved.
//

#import "ContactGroupCell.h"

@interface ContactGroupCell()
@property (weak, nonatomic) IBOutlet UILabel *name;
@property (weak, nonatomic) IBOutlet UIButton *choose;

@end
@implementation ContactGroupCell

//创建自定义可重用的cell对象
+ (instancetype)setContactGroupCellWithTableView:(UITableView *)tableView
{
    static NSString *reuseId = @"ContactGroupCell";
    ContactGroupCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseId];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle] loadNibNamed:@"ContactGroupCell" owner:nil options:nil] lastObject];
    }
    return cell;
}

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}
-(void)setGroupName:(TGroup *)groupName{
    _groupName =groupName;
    _name.text =_groupName.groupName;
    if (_groupName.selcect) {
         [_choose setBackgroundImage:[UIImage imageNamed:@"点击单选状态"] forState:UIControlStateNormal];
    }else{
        [_choose setBackgroundImage: [UIImage imageNamed:@"未点击单选"] forState:UIControlStateNormal];
    }
}

@end
